package com.leonzhangxf.aop.program;

import org.aopalliance.aop.Advice;
import org.springframework.aop.Advisor;
import org.springframework.aop.MethodBeforeAdvice;

/**
 * 编程式Advisor
 *
 * @author leonzhangxf
 * @date 20190529
 */
public class CustomAdvisor implements Advisor {

    @Override
    public Advice getAdvice() {
        return (MethodBeforeAdvice) (method, args, target) -> System.out.println("Method before.");
    }

    @Override
    public boolean isPerInstance() {
        return false;
    }
}
